package date;

import java.util.Calendar;
import java.util.Date;

public class CalenderDemo {
    public static void main(String[] args) {
        //1。实例化日历对象
        Calendar c = Calendar.getInstance();
        //2.设置日期
        c.setTime(new Date());
//        c.set(2025, Calendar.APRIL, 18);//手动设置
        //3.通过日历对象 提供的常量 来获取日期的指定内容
        System.out.println(c.get(Calendar.DAY_OF_WEEK));
        //4.还可以对日期做复杂运算
        c.add(Calendar.DAY_OF_YEAR, 5);
        c.add(Calendar.DAY_OF_MONTH, 5);
        c.add(Calendar.DAY_OF_WEEK, 5);
//        c.add(Calendar.WEEK_OF_YEAR, 2);
        System.out.println(c.getTime());
    }
}
